package com.cainiao.stock.config;

import com.cainiao.stock.properties.IdWorkerProperties;
import com.cainiao.stock.util.IdWorkers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class IdWorkerConfiguration {

    @Bean
    public IdWorkers idWorkers(IdWorkerProperties idWorkerProperties){
        return new IdWorkers(idWorkerProperties.getMachineId(), idWorkerProperties.getDataCenterId());
    }
}
